<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<html lang="en">
<%@page import="es.ats.codington.festival.domain.Visitor"%>
<html>

<head>

<link rel="Stylesheet" type="text/css" href="css/Stylesheet.css">

</head>

<body>


<h1></h1>

<% Visitor v=(Visitor) session.getAttribute("visitor");
boolean isAdmin= v.getIsAdmin();%>
<ul id="menu" align=center>

 <li><form id=NoBox action="vieweventsofuser.htm" method="post"><input id="NoBox" type="submit" name="MyPortal" value="My Portal" /></form></li>
 <li><form id=NoBox action="UpdateVisitorPage.htm" method="post"><input id="NoBox" type="submit" name="Update Personal Data" value="Update Personal Data" /></form></li>
 <li><form id=NoBox action="UpdatePasswordPage.htm" method="post"><input id="NoBox" type="submit" name="Change Password" value="Change Password" /></form></li>
<% if(isAdmin==true){%>
<li><form id=NoBox action="EventRegistrationPage.htm" method="post"><input id="NoBox" type="submit" name="New Event" value="New Event" /></form></li>
<% }%>
 <li><form id=NoBox action="ShowAllEvents.htm" method="post"><input id="NoBox" type="submit" name="Events" value="Events" /></form></li>
 <li><form id=NoBox action="LogOut.htm" method="post"><input id="NoBox" type="submit" name="LogOut" value="Log Out" /></form></li>
</ul>
               
<table>
<tr height="200" align="left">
<td>
<div id="places" align="left" text-align="left">
  <p id="placetitle">Places</p>
  <ul>

  	<li><b><ins ><a >North</a></b></ins></li>
	<li>	<form  id="places" action="ShowEventsByPlace.htm" method="post">
			<input type="hidden" name="place" value="Stadium">
			<input id="places" type="submit" name="Stadium" value="Stadium" />
			</form></li>
	<li>	<form  id="places" action="ShowEventsByPlace.htm" method="post">
			<input type="hidden" name="place" value="Theater">
			<input id="places" type="submit" name="Theater" value="Theater" />
			</form></li>
	<li>	<form  id="places" action="ShowEventsByPlace.htm" method="post">
			<input type="hidden" name="place" value="Museum">
			<input id="places" type="submit" name="Museum" value="Museum" />
			</form></li>
	<li>	<form  id="places" action="ShowEventsByPlace.htm" method="post">
			<input type="hidden" name="place" value="Large Business">
			<input id="places" type="submit" name="Large Business" value="Large Business" />
			</form></li>
	<li></li>
	<li><b><ins><a>South</a></b></ins></li>
	<li >	<form  id="places" action="ShowEventsByPlace.htm" method="post">
			<input type="hidden" name="place" value="Zoo">
			<input id="places" type="submit" name="Zoo" value="Zoo" />
			</form></li>
	<li >	<form  id="places" action="ShowEventsByPlace.htm" method="post">
			<input type="hidden" name="place" value="Park">
			<input id="places" type="submit" name="Park" value="Park" />
			</form></li>
	<li >	<form  id="places" action="ShowEventsByPlace.htm" method="post">
			<input type="hidden" name="place" value="Traditional Market">
			<input id="places" type="submit" name="Traditional Market" value="Traditional Market" />
			</form></li>
	<li >	<form  id="places" action="ShowEventsByPlace.htm" method="post">
			<input type="hidden" name="place" value="Tourist Attraction">
			<input id="places" type="submit" name="Tourist Attraction" value="Tourist Attraction" />
			</form></li>
  </ul>
</div>
</td>
<td>


<form action="UpdatePassword.htm" method="post">

<h2>Festival Registration System</h2>

<h3>Update Password</h3>

<table align=center>
   
	 
     <tr>

		<td><label for="oldpassword"> Old Password: </label></td>
		<td><input type="password" name="oldpassword" id="oldpassword" placeholder="Enter your old password" required="required" autofocus="autofocus" minlength="6" maxlength="15"></td>
	</tr>
	 
     <tr>


		<td><label for="password">New Password: </label></td>
		<td><input name="password" required="required" type="password" id="password" placeholder="Enter your password" required="required" autofocus="autofocus" minlength="6" maxlength="15"></td>
	</tr>
	<tr>
		<td><label for="confirmpassword">Confirm New Password: </label></td>
		<td><input name="password_confirm" required="required" type="password" id="password_confirm" oninput="check(this)"  placeholder="Confirm your password" required="required" autofocus="autofocus" minlength="6" maxlength="15"><td>

     </tr>

<script language='javascript' type='text/javascript'>
function check(input) {
if (input.value != document.getElementById('password').value) {
input.setCustomValidity('Password Must be Matching.');
} else {
// input is valid -- reset the error message
input.setCustomValidity('');
}
}
</script>

<tr>
<td></td><td></td>
</tr>

<tr>
<td></td><td><input type="submit" name="Accept" value="Accept"align=center/>
<button type="reset" align="center" >Cancel</button>
</td>
</tr>

</table>

</form>
</td>
</tr>
</table>
<% String error = (String) request.getAttribute("error"); %>

<%if(error!=null){ %>
<script> 
alert ("<%=error%>");
</script>

<% request.setAttribute("error",null);} %>

</body>
</html>